/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package display;

import checkimage.filterImage;
import checkimage.findVectest;
import javax.swing.JFileChooser;
import fakeimagedetection.FakeImageDetection;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;


/**
 *
 * @author rikikun
 */
public class StartGui extends javax.swing.JFrame {

    /**
     * Creates new form StartGui
     */
    private String location;
    private String name;
    private int mousex=0,mousey=0;
    private Rectangle rec=null;
    private JLabel a1=new JLabel();
    public StartGui() {
        initComponents();
        jTextField2.setVisible(false);
        jLabel2.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jButton1 = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jTextField2 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        jPanel7 = new javax.swing.JPanel();
        jButton3 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();

        jMenuItem1.setText("jMenuItem1");

        jMenuItem3.setText("jMenuItem3");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jButton1.setText("Browse");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Open");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel1.setText("File");

        jLabel2.setText("Save");

        jPanel1.setPreferredSize(new java.awt.Dimension(5000, 5000));
        jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jPanel1MousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jPanel1MouseReleased(evt);
            }
        });
        jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                jPanel1MouseDragged(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane1.setViewportView(jPanel1);

        jTabbedPane1.addTab("Original", jScrollPane1);

        jPanel2.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane2.setViewportView(jPanel2);

        jTabbedPane1.addTab("EdgeG", jScrollPane2);

        jPanel3.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane3.setViewportView(jPanel3);

        jTabbedPane1.addTab("EdgeR", jScrollPane3);

        jPanel4.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane4.setViewportView(jPanel4);

        jTabbedPane1.addTab("EdgeB", jScrollPane4);

        jPanel5.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane5.setViewportView(jPanel5);

        jTabbedPane1.addTab("Result 1", jScrollPane5);

        jPanel6.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane6.setViewportView(jPanel6);

        jTabbedPane1.addTab("Result 2", jScrollPane6);

        jPanel7.setPreferredSize(new java.awt.Dimension(5000, 5000));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 5000, Short.MAX_VALUE)
        );

        jScrollPane7.setViewportView(jPanel7);

        jTabbedPane1.addTab("Vector", jScrollPane7);

        jButton3.setText("Check");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 611, Short.MAX_VALUE)
                    .addComponent(jTextField2)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3))
                .addGap(42, 42, 42))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton1)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton2)
                        .addComponent(jLabel2)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addGap(46, 46, 46))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(33, 33, 33)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(326, Short.MAX_VALUE))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        //initial varibale 
        this.mousex=0;
        this.mousey=0;
        this.rec=new Rectangle(0,0,0,0);
        jPanel1.removeAll();
        jPanel2.removeAll();
        jPanel3.removeAll();
        jPanel4.removeAll();
        jPanel5.removeAll();
        jPanel6.removeAll();
        jPanel7.removeAll();
        a1.removeAll();
        this.repaint();
        //Start open and build
        String path=jTextField1.getText(),dispath=jTextField2.getText();
        FakeImageDetection build=new FakeImageDetection();
        if(build.startBuildImage(path,dispath)==0){
            //build.startBuildImage(path,dispath);
            System.out.print(name+":"+location);
             filterImage a=new filterImage(name,location);
           // File file=new File(path);
          //   findVectest 
            displayresult(dispath,name);
            System.out.print("Finish\n");
        }
        else{
            JOptionPane.showMessageDialog(this,
                "File not found or wrong type",
                "error",
                JOptionPane.ERROR_MESSAGE);
        }
       
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        JFileChooser fileChooser = new JFileChooser();
        File NamePath;
        if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            NamePath = fileChooser.getSelectedFile();
            name=fileChooser.getSelectedFile().getName();
            location=fileChooser.getSelectedFile().getParent();
            //========================================================================================= path
            System.out.println(name+":"+location);
            jTextField2.setText(location+File.separator);
            jTextField1.setText(NamePath + "");
            //String filename = fileChooser.getSelectedFile().getAbsolutePath();
            //txtBackUpTo.setText(filename);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MousePressed
        // TODO add your handling code here:
        this.mousex=evt.getX();
        this.mousey=evt.getY();
    }//GEN-LAST:event_jPanel1MousePressed

    private void jPanel1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseReleased
        // TODO add your handling code here:
        a1.removeAll();
        int x,y;
        x=evt.getX();
        y=evt.getY();
        BufferedImage ta;
        JLabel aa=new JLabel();
        int width=Math.abs(this.mousex-x);
        int height=Math.abs(this.mousey-y);
        if(width>0&&height>0){
            ta=new BufferedImage(width,height,BufferedImage.TRANSLUCENT);
            Graphics g=ta.createGraphics();
            g.setColor(Color.BLUE);
            g.drawRect(0, 0,width-1 ,height-1);

            ImageIcon ca=new ImageIcon(ta);
            aa.setIcon(ca);
            aa.setSize(ca.getIconWidth(), ca.getIconHeight());
            if(x>this.mousex&&y>this.mousey){
                aa.setLocation(this.mousex, this.mousey);
            }
            else if(x>this.mousex&&y<this.mousey){
                aa.setLocation(this.mousex, y);
            }
            else if(x<this.mousex&&y>this.mousey){
                aa.setLocation(x, this.mousey);
            }
            else{
                aa.setLocation(x, y);
            }
        }
        a1.add(aa);
        a1.repaint();
        //jPanel1.add();
        if(x>this.mousex&&y>this.mousey){
                this.rec=new Rectangle(this.mousex, this.mousey,width-1,height-1);
            }
            else if(x>this.mousex&&y<this.mousey){
                this.rec=new Rectangle(this.mousex, y,width-1,height-1);
            }
            else if(x<this.mousex&&y>this.mousey){
                this.rec=new Rectangle(x, this.mousey,width-1,height-1);
            }
            else{
                aa.setLocation(x, y);
                this.rec=new Rectangle(x, y,width-1,height-1);
            }
    }//GEN-LAST:event_jPanel1MouseReleased

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        if(this.rec.height!=0){
            String name;
            name=this.name;
            String []temp=name.split("\\.");
            name=temp[0];
            jPanel5.removeAll();
            jPanel5.repaint();
            jPanel6.removeAll();
            jPanel6.repaint();
            jPanel7.removeAll();
            jPanel7.repaint();
            BufferedImage gg=null;
            BufferedImage bb=null;
            BufferedImage real=null;
            //======================================================================================================== path
            try {
                real=ImageIO.read(new File(location+File.separator+this.name));
                gg=ImageIO.read(new File("filter1_"+name+".png"));
                bb = ImageIO.read(new File("filter2_"+name+".png"));
            } catch (IOException ex) {
                Logger.getLogger(findVectest.class.getName()).log(Level.SEVERE, null, ex);
            }
            Rectangle r=this.rec;
            findVectest a=new findVectest(real,gg,bb,r,name);
            Thread t=new Thread(a);
            t.start();
       /*     a.startChkPer(name,r);
            a.chkEq(r);
            a.startVector();
            a.buildImage(a.algor3,a.algor2,a.normal,name);*/
            try {
                t.join();
            } catch (InterruptedException ex) {
                Logger.getLogger(StartGui.class.getName()).log(Level.SEVERE, null, ex);
            }
            try {
                JLabel r1=new JLabel();
                JLabel r2=new JLabel();
                JLabel r3=new JLabel();
                BufferedImage br1=ImageIO.read(new File("algor2"+name+".png"));
                BufferedImage br2=ImageIO.read(new File("algor3"+name+".png"));
                BufferedImage br3=ImageIO.read(new File("normal"+name+".png"));
                ImageIcon bc1=new ImageIcon(br1);
                ImageIcon bc2=new ImageIcon(br2);
                ImageIcon bc3=new ImageIcon(br3);
                r1.setIcon(bc1);
                r1.setSize(bc1.getIconWidth(), bc1.getIconHeight());
                r1.setLocation(0, 0);
                r2.setIcon(bc2);
                r2.setSize(bc2.getIconWidth(), bc2.getIconHeight());
                r2.setLocation(0, 0);
                r3.setIcon(bc3);
                r3.setSize(bc3.getIconWidth(), bc3.getIconHeight());
                r3.setLocation(0, 0);
                jPanel5.add(r1);
                jPanel5.setSize(r1.getWidth(),r1.getHeight());
                jPanel5.setLocation(0,0);
                jPanel6.add(r2);
                jPanel6.setSize(r2.getWidth(),r2.getHeight());
                jPanel6.setLocation(0,0);
                jPanel7.add(r3);
                jPanel7.setSize(r3.getWidth(),r3.getHeight());
                jPanel7.setLocation(0,0);
            this.repaint();

            } catch (IOException ex) {
                Logger.getLogger(findVectest.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        else{
            JOptionPane.showMessageDialog(this,
                "Build your rectangle",
                "error",
                JOptionPane.WARNING_MESSAGE);
        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseDragged
        // TODO add your handling code here:
        a1.removeAll();
        int x,y;
        x=evt.getX();
        y=evt.getY();
        BufferedImage ta=null;
        JLabel aa=new JLabel();
        int width=Math.abs(this.mousex-x);
        int height=Math.abs(this.mousey-y);
        if(width>0&&height>0){
            ta=new BufferedImage(width,height,BufferedImage.TRANSLUCENT);
            Graphics g=ta.createGraphics();
            g.setColor(Color.BLUE);
            g.drawRect(0, 0,width-1 ,height-1);

            ImageIcon ca=new ImageIcon(ta);
            aa.setIcon(ca);
            aa.setSize(ca.getIconWidth(), ca.getIconHeight());
            if(x>this.mousex&&y>this.mousey){
                aa.setLocation(this.mousex, this.mousey);
            }
            else if(x>this.mousex&&y<this.mousey){
                aa.setLocation(this.mousex, y);
            }
            else if(x<this.mousex&&y>this.mousey){
                aa.setLocation(x, this.mousey);
            }
            else{
                aa.setLocation(x, y);
            }
        }
        a1.add(aa);
        a1.repaint();
    }//GEN-LAST:event_jPanel1MouseDragged
public void displayresult(String path,String name){
        try {       
            JLabel a2=new JLabel();
            JLabel a3=new JLabel();
            JLabel a4=new JLabel();
            String []temp=name.split("\\.");
            name=temp[0];
            BufferedImage t4=ImageIO.read(new File(path+File.separator+"DOG_EDGE_B_"+name+".png"));
            BufferedImage t2=ImageIO.read(new File(path+File.separator+"DOG_EDGE_G_"+name+".png"));
            BufferedImage t3=ImageIO.read(new File(path+File.separator+"DOG_EDGE_R_"+name+".png"));
            BufferedImage t1=ImageIO.read(new File(path+File.separator+this.name));
            ImageIcon c1=new ImageIcon(t1);
            ImageIcon c2=new ImageIcon(t2);
            ImageIcon c3=new ImageIcon(t3);
            ImageIcon c4=new ImageIcon(t4);
            a1.setIcon(c1);
            a1.setSize(c1.getIconWidth(), c1.getIconHeight());
            a1.setLocation(0, 0);
            a2.setIcon(c2);
            a2.setSize(c2.getIconWidth(), c2.getIconHeight());
            a2.setLocation(0, 0);
            a3.setIcon(c3);
            a3.setSize(c3.getIconWidth(), c3.getIconHeight());
            a3.setLocation(0, 0);
            a4.setIcon(c4);
            a4.setSize(c4.getIconWidth(), c4.getIconHeight());
            a4.setLocation(0, 0);
            jPanel1.add(a1);
            jPanel1.setSize(a1.getWidth(),a1.getHeight());
            jPanel1.setLocation(10,10);
            jPanel1.setPreferredSize(new Dimension(a1.getWidth(),a1.getHeight()));  
            jPanel2.add(a2);
            jPanel2.setSize(a2.getWidth(),a2.getHeight());
            jPanel2.setLocation(10,10);
            jPanel2.setPreferredSize(new Dimension(a2.getWidth(),a2.getHeight()));
            jPanel3.add(a3);
            jPanel3.setSize(a3.getWidth(),a3.getHeight());
            jPanel3.setLocation(10,10);
            jPanel3.setPreferredSize(new Dimension(a3.getWidth(),a3.getHeight()));
            jPanel4.add(a4);
            jPanel4.setSize(a4.getWidth(),a4.getHeight());
            jPanel4.setLocation(10,10);
            jPanel4.setPreferredSize(new Dimension(a4.getWidth(),a4.getHeight()));
            this.repaint();
        } catch (IOException ex) {
            Logger.getLogger(StartGui.class.getName()).log(Level.SEVERE, null, ex);
        }
}
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(StartGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(StartGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(StartGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(StartGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
               StartGui disStart= new StartGui();
               //disStart.setBounds(0, 0, 800, 800);
               disStart.setExtendedState(disStart.MAXIMIZED_BOTH);
               disStart.pack();
               disStart.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    // End of variables declaration//GEN-END:variables
}
